#include <stdio.h>
int main()
{
    for(int i = 100; i < 1000; i ++){
        int n = i, sum = 0, temp;
        while(n){
            temp = n%10;
            n /=10;
            sum += temp * temp * temp;
        }
        if(sum == i)
            printf("%d\n", i);
    }
    return 0;
}